import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";

//获取批量编辑头部
export const getTableFieldsApi = (params: FormData) => {
  return http.post(PORT1 + `/goods-archive/excel-online-edit/get-table-fields`, params, { cancel: false, loading: false });
};
//获取数据
export const getTableListApi = (params: FormData) => {
  return http.post(PORT1 + `/goods-archive/excel-online-edit/get-table-list`, params, { cancel: false, loading: true });
};
//保存批量编辑数据
export const saveTableGoodsApi = (params: FormData) => {
  return http.post(PORT1 + `/goods-archive/excel-online-edit/save-table-goods`, params, { cancel: false, loading: false });
};
// 导出列表数据
export const exportDataByTable = (id: string | number) =>
  http.get<{ url: string; name: string }>(`${PORT1}/goods-archive/goods-import/export`, { id }, { loading: false });
// 导出错误数据
export const exportDataByError = (id: string | number) =>
  http.get<{ url: string; name: string }>(`${PORT1}/goods-archive/goods-import/export-error`, { id }, { loading: false });
